package cn.edu.hitsz.conf;

/**
 * SET DATA BASE PARAMETERS FOR THE MONGO DATABASE HOST PORT USERNAME
 * USERPASSWORD ARE NEEDED
 * 
 * @author mingchen
 * @date 2015年8月9日
 */
public class DatabaseConfig {
	// SINGLE MODE
	private final static DatabaseConfig dbcnf = new DatabaseConfig(
			LoadConfiguration.getStringValueByKey("host"),
			LoadConfiguration.getIntValueByKey("port"),
			LoadConfiguration.getStringValueByKey("dbuser"),
			LoadConfiguration.getStringValueByKey("dbpassword"));
	// PARAMETERS
	private final String host;
	private final int port;
	private final String userName;
	private final String userPwd;

	/**
	 * 
	 * Private Constructor function of Class
	 * 
	 * @param host
	 * @param port
	 * @param userName
	 * @param userPwd
	 */
	private DatabaseConfig(String host, int port, String userName,
			String userPwd) {
		this.host = host;
		this.port = port;
		this.userName = userName;
		this.userPwd = userPwd;
	}

	public static DatabaseConfig getDBConfig() {
		return dbcnf;
	}

	/**
	 * @return the host
	 */
	public String getHost() {
		return host;
	}

	/**
	 * @return the port
	 */
	public int getPort() {
		return port;
	}

	/**
	 * @return the userName
	 */
	public String getUserName() {
		return userName;
	}

	/**
	 * @return the userPwd
	 */
	public String getUserPwd() {
		return userPwd;
	}

}
